const Mock = require('mockjs');
const dayjs = require('dayjs');
const Random = Mock.Random;

let perms = [
  {
    id: 0,
    name: '吃',
    key: 'eat',
  },
  {
    id: 1,
    name: '玩',
    key: 'play',
  },
  {
    id: 2,
    name: '干活',
    key: 'work',
  },
  {
    id: 3,
    name: '毒',
    key: 'du',
  },
  {
    id: 4,
    name: '管理',
    key: 'manage',
  },
  {
    id: 5,
    name: '新增车辆',
    key: 'car:add',
  },
  {
    id: 6,
    name: '删除车辆',
    key: 'car:del',
  },
  {
    id: 7,
    name: '修改车辆',
    key: 'car:update',
  },
  {
    id: 8,
    name: '新增任务',
    key: 'task:update',
  },
  {
    id: 9,
    name: '删除任务',
    key: 'task:del',
  },
];

let routers = [
  {
    path: '/',
    hidden: true,
    component: 'Layout',
    meta: { title: '全局总览', icon: 'm-qjzl', noCache: false },
    children: [
      {
        name: 'Map',
        path: 'map',
        hidden: false,
        component: 'biz/map/map',
        meta: { title: '全局总览', icon: 'm-qjzl', noCache: false },
      },
    ],
  },
  {
    path: '/',
    hidden: false,
    component: 'Layout',
    meta: { title: '车辆管理', icon: 'm-car', noCache: false },
    children: [
      {
        name: 'Car',
        path: 'car',
        hidden: false,
        component: 'biz/car/car',
        meta: { title: '车辆管理', icon: 'm-car', noCache: false },
      },
    ],
  },
  {
    path: '/',
    hidden: false,
    component: 'Layout',
    meta: { title: '任务管理', icon: 'm-rw', noCache: false },
    children: [
      {
        name: 'Task',
        path: 'task',
        hidden: false,
        component: 'biz/task/task',
        meta: { title: '任务管理', icon: 'm-rw', noCache: false },
      },
    ],
  },
];

let roles = [
  {
    id: 0,
    name: '保安',
    key: 'superman',
    perms: [...perms],
    routers: [routers[0], routers[1], routers[2]],
  },
  {
    id: 1,
    name: '渣男',
    key: 'bad',
    perms: [perms[0], perms[1], perms[3], perms[6], perms[8]],
    routers: [routers[0], routers[2]],
  },
  {
    id: 2,
    name: '好人',
    name: 'man',
    perms: [perms[0], perms[1], perms[2], perms[9]],
    routers: [routers[0], routers[1]],
  },
];

let users = [
  {
    id: 100,
    name: '奥特曼',
    gender: 1,
    phone: '13311111111',
    password: 123456,
    avatar: Random.image('200x200', Random.color()),
    money: 888,
    role: roles[0],
  },
  {
    id: 101,
    name: '小怪兽',
    gender: 2,
    phone: '13322222222',
    password: 123456,
    avatar: null,
    avatar: Random.image('200x200', Random.color()),
    money: 77,
    role: roles[1],
  },
  {
    id: 102,
    name: '小团团',
    gender: 2,
    phone: '13333333333',
    password: 123456,
    avatar: null,
    avatar: Random.image('200x200', Random.color()),
    money: 100,
    role: roles[2],
  },
];

module.exports = {
  users,
  roles,
};
